<template>
	<view class="search-container" @click="searchBoxHandler">
		<view class="search-box">
			<!-- 使用uni-ui提供的组件 -->
			<uni-icons type="search" size="17"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-search",
		data() {
			return {
				
			};
		},
		methods:{
			// 将自定义组件的click方法传给父组件
			searchBoxHandler(){
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss">
.search-container{
	height: 45px;
	background-color: #c00000;
	display: flex;
	align-items: center;
	justify-content: center;
	.search-box{
		height: 30px;
		background-color: #fff;
		width: 90%;
		border-radius: 20px;
		display: flex;
		justify-content: center;
		align-items: center;
		.placeholder{
			margin-left: 5px;
			font-size: 15px;
		}
	}
}
</style>
